package project.bob.screen;

import java.awt.Graphics;

import project.bob.Art;
import project.bob.Input;

public class AboutScreen extends Screen {
	
    private GameScreen parent;
	
    public AboutScreen(GameScreen parent) {
        this.parent = parent;
    }
	
    private String[] msg = { "Coders: Red_Squirrel" ,"Painter: Alex"};
    
    
	public void render(Graphics g){
		parent.render(g);
        int xs = 0;
        int ys = msg.length;
        for (int y = 0; y < msg.length; y++) {
            int s = msg[y].length();
            if (s > xs) xs = s;
        }

        xs += 1;
        int xp = 40;
        int yp = 40;
        for (int x = 0 - 1; x < xs + 1; x++) {
            for (int y = 0 - 1; y < ys + 1; y++) {
                int xf = 1;
                int yf = 12;
                if (x < 0) xf--;
                if (y < 0) yf--;
                if (x >= xs) xf++;
                if (y >= ys) yf++;
                g.drawImage(Art.font[xf][yf], xp + x * 6, yp + y * 6, null);
            }
        }
        for (int y = 0; y < msg.length; y++) {
            drawString(msg[y], g, xp + 6, yp + y * 6);
        }
	}
	
	
	public void tick(Input input) {
		if (input.buttons[Input.ESCAPE] && !input.oldButtons[Input.ESCAPE]) {
            setScreen(new PauseScreen(parent));
		}
	}
}
